package com.ap.core.dao.impl;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.ap.core.common.types.SystemTypeCode;
import com.ap.core.dao.AbstractAPCoreBaseJpaDao;
import com.ap.core.dao.EndPointRoutingDao;
import com.ap.core.domain.EndPointRouting;

/**
 * User: Ranjit.Singh
 * Jpa Implementation class for {@link com.ap.core.dao.OrderPaymentDao}
 */
public class JpaEndPointRoutingDao extends AbstractAPCoreBaseJpaDao<EndPointRouting, Long> implements EndPointRoutingDao{

   


	@Override
	public EndPointRouting findById(Long primaryKey) {
		 return findById(EndPointRouting.class, primaryKey);
	}

	@Override
	public EndPointRouting findByTargetIdAndTypeAndOperationName(String TargetId, SystemTypeCode systemType, String OperationName) {
		final Criteria criteria = getSession().createCriteria(EndPointRouting.class);
        criteria.add(Restrictions.eq("destinationId", TargetId));
        criteria.add(Restrictions.eq("operationName", OperationName));
        criteria.add(Restrictions.eq("destinationType", systemType));
        criteria.setReadOnly(true);
        return (EndPointRouting)criteria.uniqueResult();
	}



   
    
    
  

}
